﻿using Heng.Elements.Core.Model.Repository.EF.Infrastructure.Repositories;
using Heng.Elements.ERD.Model.Entities;
using Heng.Elements.ERD.Model.Repositories;
using Heng.Elements.ERD.Model.Repository.EF.Contexts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Heng.Elements.ERD.Model.Repository.EF.Repositories
{
    public class DomainEntityRepository : EFEntityRepository<DomainEntity, CoreEntities>, IDomainEntityRepository
    {
        public IEnumerable<DomainEntity> GetByDomain(long domainId)
        {
            var entities = from ent in this.ContextFacade.DbContext.DomainEntities
                           where ent.Domain.Id == domainId && ent.Status == 0
                           select ent;

            return entities.ToList();
        }
    }
}
